<?php

error_reporting(0);

$ponteiro  = opendir("../download/libs");
while ($nome_itens = readdir($ponteiro))
{
	$itens[] = $nome_itens;
}
sort($itens);

foreach ($itens as $listar) 
{
	if ($listar!="." && $listar!="..")
	{
		if (is_dir($listar)) 
		{
			$pastas[]=$listar;
		}
		else
		{
			$arquivos[]=$listar;
		}
	}
}


$query = $_GET["need"];
$latest = "";

foreach($arquivos as $name)
{
	rewinddir();
	$sha1 = sha1_file("../download/libs/$name");
	$sha1 = "sha1=$sha1";
	$link = "link=/download/libs/$name";
	$name = "name=$name";
	$latest .= "$name;$sha1;$link\n";

}

$latest = trim($latest);

if($query)
{
$md5 = md5($latest);
print($md5);
}
else
{
print($latest);
}

?>